﻿using crip.Database;
using crip.Models;
using crip.Services.IRepositorys;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;

namespace crip.Services.Repositorys
{
    public class UserRepository : BaseRepository<CripUser>, IUserRepository
    {
        private readonly CripDbContext _cripDbContext;
        public UserRepository(CripDbContext cripDbContext) : base(cripDbContext)
        {
            _cripDbContext = cripDbContext;
        }
        //添加角色给用户
        public async Task AddRoleToUserAsync(IdentityUserRole<string> identityUserRole)
        {
            await _cripDbContext.UserRoles.AddAsync(identityUserRole); 
        }

    }
}
